home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / syntax / bib.vim < prev    next >
Encoding:
Text File  |  1998-02-14  |  2.2 KB  |  60 lines

  1. " Vim syntax file
  2. " Language   : BibTeX (bibtex)
  3. " Maintainer : Bernd Feige <feige@ukl.uni-freiburg.de>
  4. " Last change: Nov 26, 1997
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. " Read the TeX syntax to start with
  10. "source <sfile>:p:h/tex.vim
  11.  
  12. " Ignore case
  13. syn case ignore
  14.  
  15. syn region bibString    start=+[^\\]"+hs=s+1 skip=+\\\\\|\\"+ end=+"+
  16. syn region bibString    start=+^"+ skip=+\\\\\|\\"+ end=+"+
  17. syn keyword bibEntryKw contained    crossref author title pages journal
  18. syn keyword bibEntryKw contained    year month volume number month publisher
  19. syn keyword bibEntryKw contained    series editor key note
  20. syn keyword bibEntryKw contained    booktitle chapter type howpublished
  21. syn keyword bibEntryKw contained    organization institution school address
  22. " Non-standard:
  23. syn keyword bibEntryKw contained    abstract keywords annote isbn issn
  24. syn match bibVariable contained    "=\s*[^= \t{}]\+"hs=s+1
  25. syn match bibVarLine oneline transparent "^\s*\S\+\s*=" contains=bibEntryKw,bibVariable
  26. syn match bibEntryLine oneline transparent "^\s*\S\+\s*=\s*{" contains=bibEntryKw
  27.  
  28. syn match bibKey contained    "{\s*[^ \t}]\+,"hs=s+1,he=e-1
  29. syn keyword bibType contained    article book inbook booklet collection incollection
  30. syn keyword bibType contained    proceedings inproceedings conference
  31. syn keyword bibType contained    manual mastersthesis phdthesis techreport
  32. syn keyword bibType contained    misc unpublished
  33. syn region bibDataSetStart oneline start="^\s*@" end="$" contains=bibType,bibKey
  34.  
  35. syn keyword bibDefineKw contained    string
  36. syn match bibVarDef contained    "[^= \t{}]\+\s*="he=e-1
  37. syn match bibDefineEntry oneline transparent    "^\s*@string\s*{[^=]\+=" contains=bibDefineKw,bibVarDef
  38.  
  39. syn match    bibUnescapedSpecial    "[^\\][%&]"hs=s+1
  40. " A comment line starts with a % at the start of the line
  41. syn match    bibComment    +^\s*%.*$+
  42.  
  43. if !exists("did_bibfile_syntax_inits")
  44.   let did_bibfile_syntax_inits = 1
  45.   " The default methods for highlighting.  Can be overridden later
  46.   hi link bibString    String
  47.   hi link bibEntryKw    Statement
  48.   hi link bibType        Function
  49.   hi link bibDefineKw    Function
  50.   hi link bibKey        Number
  51.   hi link bibVariable    Special
  52.   hi link bibVarDef    Special
  53.   hi link bibUnescapedSpecial    Error
  54.   hi link bibComment    Comment
  55. endif
  56.  
  57. let b:current_syntax = "bibfile"
  58.  
  59. " vim: ts=18
  60.